<template>
	<view class="mainpadding">
		<u-modal :show="show" cancelColor="#555" confirmColor="#2361FF" :showCancelButton="true" :title="title"
			@cancel="show=false" @confirm="confirm"></u-modal>
			<view class="flexbetween xiahuaxian" @click="jumper('/pages_mypage/yijianfk')">
				<view class="sanshier xiaohei">意见反馈</view>
				<u-icon name="arrow-right" color="#CCCCCC"></u-icon>
			</view>
			<view class="flexbetween xiahuaxian margin_top" @click="jumper('/pages/system/system?type=4')">
				<view class="sanshier xiaohei">关于我们</view>
				<u-icon name="arrow-right" color="#CCCCCC"></u-icon>
			</view>
			<view class="flexbetween xiahuaxian margin_top" @click="jumper('/pages/system/system?type=1')">
				<view class="sanshier xiaohei">用户协议</view>
				<u-icon name="arrow-right" color="#CCCCCC"></u-icon>
			</view>
			<view class="flexbetween xiahuaxian margin_top" @click="jumper('/pages/system/system?type=2')">
				<view class="sanshier xiaohei">隐私政策</view>
				<u-icon name="arrow-right" color="#CCCCCC"></u-icon>
			</view>
			<view class="flexbetween xiahuaxian margin_top" @click="jumper('/pages/system/system?type=2')">
				<view class="sanshier xiaohei">是否开启青少年模式</view>
				<u-radio-group v-model="qingshaonian" placement="row" circle style="flex: 0;">
					<u-radio activeColor="#2361ff" :customStyle="{marginRight: '30rpx'}" label="是" :name="1"></u-radio>
					<u-radio activeColor="#2361ff" label="否" :name="0"></u-radio>
				</u-radio-group>
			</view>
			<view class="flexbetween xiahuaxian margin_top" @click="jumper('/pages_mypage/xiugaizfb')">
				<view class="sanshier xiaohei">修改支付宝</view>
				<u-icon name="arrow-right" color="#CCCCCC"></u-icon>
			</view>
			<view class="flexbetween xiahuaxian margin_top" @click="zxshow=true">
				<view class="sanshier xiaohei">注销账号</view>
				<u-icon name="arrow-right" color="#CCCCCC"></u-icon>
			</view>
		<view class="gudingdb ffffff mainpadding" @click="show=true">
			<view class="bigbtn">退出登录</view>
		</view>
		<u-modal title='警告' :show="zxshow" content="账号注销后，您的系统数据将不再可用。请慎重处理!!!" @confirm="zxconfirm" style='text-align: center;' confirmColor="#999"
			confirmText="确认注销" cancelText="再想想" cancelColor="#2361FF" buttonReverse showCancelButton
			@cancel='zxshow=false'></u-modal>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				show: false,
				title: '确定要退出当前账户么？',
				zxshow:false,
				qingshaonian:0,
			}
		},
		onShow() {
			this.qingshaonian = uni.getStorageSync("qingshaonian") || 0
		},
		watch:{
			qingshaonian(newval){
				uni.setStorageSync("qingshaonian",newval)
			}
		},
		methods: {
			zxconfirm() {
				this.zxshow = false;
				httpRequest.request('/api/user/zxUser', 'GET', {
				}, false, false, true).then(res => {
					httpRequest.toast(res.msg);
					if(res.code==1){
						uni.setStorageSync('token', "");
						setTimeout(() => {
							uni.reLaunch({
								url: '/pages/login/login?type=1'
							})
						}, 1000)
					}
				})
			},
			jumper(url) {
				uni.navigateTo({
					url: url
				})
			},
			confirm() {
				this.show = false;
				uni.setStorageSync('token', "");
				httpRequest.toast("退出登录成功")
				setTimeout(() => {
					uni.reLaunch({
						url: '/pages/login/login?type=1'
					})
				}, 1000)
				
			},
		}
	}
</script>

<style>

</style>
